#ifndef _PFS_FUNCTIONS_H_
#define _PFS_FUNCTIONS_H_ XD

#include <ctime>
#include <vector>
#include "pfs_item.h"
#include "pfs_base.h"



#pragma region MatingSelection

std::vector<Solution> TournamentSelection(const std::vector<Answer>&, const int);

std::vector<Solution> WindowingRouletteMatingSelection(const std::vector<Answer>&, const int);

#pragma endregion MatingSelection

#pragma region Reproduce

std::vector<Solution> OXReproduce(const std::vector<Solution>&);

std::vector<Solution> LOXReproduce(const std::vector<Solution>&);

std::vector<Solution> CycleReproduce(const std::vector<Solution>&);

std::vector<Solution> PMReproduce(const std::vector<Solution>&);

std::vector<Solution> POXReproduce(const std::vector<Solution>&);

std::vector<Solution> PPXReproduce(const std::vector<Solution>&);

#pragma endregion Reproduce

#pragma region Mutate

Solution RandomSwapMutate(const Solution&);

Solution RandomInsertMutate(const Solution&);

#pragma endregion Mutate

#pragma region LocalSearch

Answer IILocalSearch (const Solution&, const PFS_Item&, clock_t time_limit);

Answer TSLocalSearch (const Solution&, const PFS_Item&, clock_t time_limit);

Answer SALocalSearch(const Solution& o_solution, const PFS_Item& pfs_item, clock_t time_limit);

#pragma endregion LocalSearch

Solution GetRandomSolution(const PFS_Item& pfs_item);

std::vector<Solution> InitPopulation(const PFS_Item& pfs_item, size_t size);

std::vector<Answer>
Evaluate(const std::vector<Solution>& solutions, const PFS_Item& pfs_itme);

std::vector<Solution>
AnswersToSolutions(const std::vector<Answer>& answers);

std::vector<Solution>
EnvironmentalSelection(std::vector<Answer> answers, size_t size);

#endif  // _PFS_FUNCTIONS_H_
